﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AppDesignerTest
{
    [TestClass]
    public class SamplesTests : TestHelper
    {
        [TestMethod]
        public void Intro1()
        {
            //测试一般普通情况
            TestLoadingXaml(@"
                            <Page
                                xmlns=""http://schemas.microsoft.com/netfx/2007/xaml/presentation""
                                xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml""
                                >
                              <StackPanel
                                xmlns=""http://schemas.microsoft.com/netfx/2007/xaml/presentation""
                                xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
                                <TextBlock>
                                  Hello, World!
                                </TextBlock>
                              </StackPanel>
                            </Page>");
        }

        [TestMethod]
        public void Intro2()
        {
            //测试有注释的情况
            TestLoadingXaml(@"
                            <!--<SnippetSimpleLayout>-->
                            <StackPanel
                              xmlns=""http://schemas.microsoft.com/netfx/2007/xaml/presentation""
                              xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
                              <Button HorizontalAlignment=""Left""
                                      Width=""100""
                                      Margin=""10,10,10,10"">Button 1</Button>
                              <Button HorizontalAlignment=""Left""
                                      Width=""100""
                                      Margin=""10,10,10,10"">Button 2</Button>
                              <Button HorizontalAlignment=""Left""
                                      Width=""100""
                                      Margin=""10,10,10,10"">Button 3</Button>
                            </StackPanel>
                            <!--</SnippetSimpleLayout>-->");
        }

        [TestMethod]
        public void Intro3()
        {
            TestLoadingXaml(@"
                        <Page
	                        xmlns=""http://schemas.microsoft.com/netfx/2007/xaml/presentation""
	                        xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
	                        <DockPanel
		                        xmlns=""http://schemas.microsoft.com/netfx/2007/xaml/presentation""
		                        xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
		                        <TextBlock Background=""LightBlue""
		                                   DockPanel.Dock=""Top"">Some Text</TextBlock>
		                        <TextBlock DockPanel.Dock=""Bottom""
		                                   Background=""LightYellow"">Some text at the bottom of the page.</TextBlock>
		                        <TextBlock DockPanel.Dock=""Left""
		                                   Background=""Lavender"">Some More Text</TextBlock>
		                        <DockPanel Background=""Bisque"">
			                        <StackPanel DockPanel.Dock=""Top"">
				                        <Button HorizontalAlignment=""Left""
				                                Height=""30px""
				                                Width=""100px""
				                                Margin=""10,10,10,10"">Button1</Button>
				                        <Button HorizontalAlignment=""Left""
				                                Height=""30px""
				                                Width=""100px""
				                                Margin=""10,10,10,10"">Button2</Button>
			                        </StackPanel>
			                        <TextBlock Background=""LightGreen"">Some Text Below the Buttons</TextBlock>
		                        </DockPanel>
	                        </DockPanel>
                        </Page>
                        ");
        }

        [TestMethod]
        public void Intro4()
        {
            TestLoadingXaml(@"
		                    <Page
                                xmlns=""http://schemas.microsoft.com/netfx/2007/xaml/presentation""
                                xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"">
                                <StackPanel Background=""LightBlue"">
                                    <TextBlock Margin=""10,10,10,10"">Start Page</TextBlock>
                                    <TextBlock  HorizontalAlignment=""Left"" Margin=""10,10,10,10"">
                                    <Hyperlink  NavigateUri=""Page2.xaml"">Go To Page 2</Hyperlink>
                                    </TextBlock>
                                </StackPanel>
                            </Page>");
        }
    }
}
